def count_words(file_path,content):
    with open(file_path,"w",encoding="utf-8") as file:
        file.write(content)
file_path='example2.txt'
content="Leo"
count_words(file_path,content)

     